package com.hsteach.web.controller.wage;

import com.hsteach.common.core.controller.BaseController;
import com.hsteach.common.core.domain.AjaxResult;
import com.hsteach.common.core.page.TableDataInfo;
import com.hsteach.service.wage.WageReleaseService;
import com.hsteach.service.wage.WageTempSnapshotService;
import com.hsteach.web.controller.wage.vo.AppWageListVo;
import com.hsteach.web.dto.PageDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 工资条Controller
 * 
 * @author fanxquer
 * @date 2023-07-16
 */
@Api(value = "App工资条", tags = "App工资条")
@RestController
@RequestMapping("/wage")
public class WageController extends BaseController
{
    @Autowired
    private WageReleaseService wageReleaseService;

    @Autowired
    private WageTempSnapshotService wageTempSnapshotService;

    /**
     * 查询工资发布列表
     */
    @ApiOperation("查询工资条列表")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody PageDto dto)
    {
        List<AppWageListVo> appWageListVos = wageReleaseService.selectWageList(dto);
        return getDataTable(appWageListVos);
    }

    /**
     * 获取工资信息详情
     */
    @ApiOperation("查询工资条详情")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(wageReleaseService.selectWageInfo(id));
    }
}
